def try_set_attr(book_vm, attr, value):
    if not hasattr(book_vm, attr):
        setattr(book_vm,attr,value)

def try_set_attrs(book_vm, attr_dict):
    for k,v in attr_dict.items():
        try_set_attr(book_vm, k,v)